#ifndef __UART_H_
#define __UART_H_

#define TX2 P01//P13
#define RX2 P00//P14

#define TX3 P11//P01
#define RX3 P12//P00

extern void uart0_recv_time_check(void);
extern bool_t uart0_recv_event(void);
extern void clr_uart0_recv_event(void);

extern void uart1_recv_time_check(void);
extern bool_t uart1_recv_event(void);
extern void clr_uart1_recv_event(void);

extern void uart2_recv_time_check(void);
extern bool_t uart2_recv_event(void);
extern void clr_uart2_recv_event(void);

extern void uart3_recv_time_check(void);
extern bool_t uart3_recv_event(void);
extern void clr_uart3_recv_event(void);

extern uint8_t uart_ringbuffer_tx_read(uint8_t port, uint8_t  *c);
extern void    uart_ringbuffer_rx_write(uint8_t port, uint8_t c);

extern void    uart_ringbuffer_init(void);

extern void    uart0_puts(uint8_t *s, uint8_t num);
extern uint8_t uart0_gets(uint8_t *s);

void set_uart0_recv_counter(uint8_t num);
void set_uart0_recv_start_flag(uint8_t status);

extern void    uart1_puts(uint8_t *s, uint8_t num);
extern uint8_t uart1_gets(uint8_t *s);

extern void    uart2_puts(uint8_t *s, uint8_t num);
extern uint8_t uart2_gets(uint8_t *s);

extern void    uart3_puts(uint8_t *s, uint8_t num);
extern uint8_t uart3_gets(uint8_t *s);

void set_uart1_recv_counter(uint8_t num);
void set_uart1_recv_start_flag(uint8_t status);

void set_uart2_recv_counter(uint8_t num);
void set_uart2_recv_start_flag(uint8_t status);

void set_uart3_recv_counter(uint8_t num);
void set_uart3_recv_start_flag(uint8_t status);

void check_tx_IRQ(void);
#endif